package com.ruoyi.memo.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.memo.mapper.MemoScheduleMapper;
import com.ruoyi.memo.domain.MemoSchedule;
import com.ruoyi.memo.service.IMemoScheduleService;

/**
 * 日程Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-12
 */
@Service
public class MemoScheduleServiceImpl implements IMemoScheduleService 
{
    @Autowired
    private MemoScheduleMapper memoScheduleMapper;

    /**
     * 查询日程
     * 
     * @param id 日程主键
     * @return 日程
     */
    @Override
    public MemoSchedule selectMemoScheduleById(Long id)
    {
        return memoScheduleMapper.selectMemoScheduleById(id);
    }

    /**
     * 查询日程列表
     * 
     * @param memoSchedule 日程
     * @return 日程
     */
    @Override
    public List<MemoSchedule> selectMemoScheduleList(MemoSchedule memoSchedule)
    {
        return memoScheduleMapper.selectMemoScheduleList(memoSchedule);
    }

    /**
     * 新增日程
     * 
     * @param memoSchedule 日程
     * @return 结果
     */
    @Override
    public int insertMemoSchedule(MemoSchedule memoSchedule)
    {
        memoSchedule.setCreateTime(DateUtils.getNowDate());
        return memoScheduleMapper.insertMemoSchedule(memoSchedule);
    }

    /**
     * 修改日程
     * 
     * @param memoSchedule 日程
     * @return 结果
     */
    @Override
    public int updateMemoSchedule(MemoSchedule memoSchedule)
    {
        memoSchedule.setUpdateTime(DateUtils.getNowDate());
        return memoScheduleMapper.updateMemoSchedule(memoSchedule);
    }

    /**
     * 批量删除日程
     * 
     * @param ids 需要删除的日程主键
     * @return 结果
     */
    @Override
    public int deleteMemoScheduleByIds(Long[] ids)
    {
        return memoScheduleMapper.deleteMemoScheduleByIds(ids);
    }

    /**
     * 删除日程信息
     * 
     * @param id 日程主键
     * @return 结果
     */
    @Override
    public int deleteMemoScheduleById(Long id)
    {
        return memoScheduleMapper.deleteMemoScheduleById(id);
    }
}
